package com.shoeHouse.commodityCategory.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shoeHouse.commodityCategory.dao.CommodityCategoryMapper;
import com.shoeHouse.commodityCategory.model.CommodityCategory;
import com.shoeHouse.commodityCategory.model.CommodityCategoryExample;
import com.shoeHouse.commodityCategory.model.CommodityCategoryExample.Criteria;
import com.shoeHouse.util.PageHelper;
@Service
public class CommodifyCategoryServiceImpl implements CommodifyCategoryService {
	@Autowired
    private CommodityCategoryMapper commodityCategoryMapper;
	@Override
	public void save(CommodityCategory o) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteAll(String ids) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void removeAll(String ids) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(CommodityCategory o) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int count() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<CommodityCategory> getAll(CommodityCategory category, PageHelper pageHelper) {
		// TODO Auto-generated method stub
		CommodityCategoryExample example=new CommodityCategoryExample();
		Criteria criteria=example.createCriteria();
		System.out.println("############################################");
		criteria.andStatusEqualTo("0");
	/*	if(pageHelper.getPageSize()==0){
			List<CommodityCategory> list=commodityCategoryMapper.selectByExample(example);
	
		
		
		}*/
		example.setOrderByClause("gmt_modified DESC");
		List<CommodityCategory> list=commodityCategoryMapper.selectByExample(example);
		return list;
	}

	@Override
	public CommodityCategory getSingle(CommodityCategory commodityCategory) {
		// TODO Auto-generated method stub
		System.out.println("#################333"+commodityCategory.getId());
		CommodityCategory category=commodityCategoryMapper.selectByPrimaryKey(commodityCategory.getId());
		return category;
	}

}
